home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Aminet 21
/
Aminet 21 (1997)(GTI - Schatztruhe)[!][Oct 1997].iso
/
Aminet
/
util
/
rexx
/
LabelRexx.lha
/
label.rexx
next >
Wrap
OS/2 REXX Batch file
|
1997-07-30
|
4KB
|
187 lines
/* WW6 Label Template Creator - by Rudy Kohut 1997 */
options results
tm=0
bm=0
lm=0
rm=0
col=0
num_labels=0
ps=""
munit=""
pagewidth=0
pagelength=0
WIZARDREQ TITLE "Label Sheet Layout" LABEL "Enter data needed to design label sheet",
LABEL "Enter dimensions using your page default measurement units",
LABEL "as set in your preferences (These appear on the ruler).",
LABEL "NOTE: Odd things happen if you mix units of measurement!!",
TEXTBOX 1 "Pagesize (A4 or USLetter):" TEXTBOX 2 "No. of Label Columns:",
TEXTBOX 3 "TOP Page Margin:" TEXTBOX 4 "BOTTOM Page Margin:",
TEXTBOX 5 "LEFT Page Margin:" TEXTBOX 6 "RIGHT Page Margin:",
TEXTBOX 7 "Number of Labels in One Column:" TEXTBOX 8 "Measurement System (cm, mm or in):",
BUTTON 1 "_OK" BUTTON "-1" "_CANCEL"
IF result = -1 then exit
WIZARD_GETTEXTBOX 1
ps=result
WIZARD_GETTEXTBOX 2
col=result
WIZARD_GETTEXTBOX 3
tm=result
WIZARD_GETTEXTBOX 4
bm=result
WIZARD_GETTEXTBOX 5
lm=result
WIZARD_GETTEXTBOX 6
rm=result
WIZARD_GETTEXTBOX 7
num_labels=result
WIZARD_GETTEXTBOX 8
munit=result
If UPPER(LEFT(ps,1))="U" then do
ps="USLetter"
pagewidth=8.5
pagelength=11
end
If UPPER(LEFT(ps,1))="A" then do
test=UPPER(LEFT(munit,1))
select
when test="M" then do
ps="A4"
pagewidth=210
pagelength=297
end
when test="C" then do
ps="A4"
pagewidth=21
pagelength=29.7
end
otherwise
ps="A4"
pagewidth=8.27
pagelength=11.71
end
end
If UPPER(LEFT(ps,1))~="U" & UPPER(LEFT(ps,1))~="A" then do
REQUESTNOTIFY PROMPT "Sorry, page size not recognised!"
exit
end
rw=0
rh=0
lw=0
lh=0
rw=pagewidth-(rm+lm) /* usable width of the page */
rh=pagelength-(bm+tm) /* usable length of the page */
lw=rw/col /* label width */
lh=rh/num_labels /* label height */
Select
when UPPER(LEFT(munit,1))="I" then do
tflm=.05
tfrm=.05
tftm=.05
tfbm=.05
end
when UPPER(LEFT(munit,1))="C" then do
tftm=.3
tfbm=.3
tflm=.3
tfrm=.3
end
otherwise
tftm=3
tfbm=3
tflm=3
tfrm=3
end
NEW PORTNAME WWLABEL
ADDRESS WWLABEL
DOCUMENT ps lm rm tm bm
WIZARDREQ TITLE "Label Style Data" LABEL "Enter Styles to Apply to Labels",
TEXTBOX 1 "Fillcolour (default=TRANSPARENT):",
TEXTBOX 2 "Borderstyle (default=SINGLELINE):",
TEXTBOX 3 "Textflow (default=NONE):",
TEXTBOX 4 "Borderthickness in pts (default=0):",
TEXTBOX 5 "Bordercolour (default=Black):",
BUTTON 1 "_OK"
WIZARD_GETTEXTBOX 1
fill=result
if fill="" then
fill="Transparent"
WIZARD_GETTEXTBOX 2
bstyle=result
if bstyle="" then bstyle="Single Line"
WIZARD_GETTEXTBOX 3
tflow=result
if tflow="" then tflow="None"
WIZARD_GETTEXTBOX 4
bthick=result
if bthick="" then bthick="0pt"
else bthick=bthick||"pt"
WIZARD_GETTEXTBOX 5
bcolour=result
if bcolour="" then
bcolour="Black"
a=0
b=0
DO i = 1 to col
a = lm+(lw*(i-1))
b = tm
DO j = 1 to num_labels
DRAWTEXTFRAME 1 a b lw lh tflm tfrm tftm tfbm fill bthick bcolour bstyle tflow
objectid.i.j=result
b = b+lh
end
end
WIZARDREQ TITLE "Label Merge Text" LABEL "Enter mail merge text eg. «Name»",
LABEL "Note: use ALT+9 keys for « and ALT+0 keys for »",
LABEL "Not all boxes need be filled in!",
LABEL "The «:NEXT» command is automatically appended.",
TEXTBOX 1 "Text 1:" TEXTBOX 2 "Text 2:" TEXTBOX 3 "Text 3:" TEXTBOX 4 "Text 4:" TEXTBOX 5 "Text 5:",
BUTTON 1 "_OK" BUTTON "-1" "_CANCEL AND SAVE" BUTTON 2 "_QUIT"
if result=-1 then do
SAVEAS
exit
end
if result=2 then exit
wtext.=""
DO n= 1 to 5
WIZARD_GETTEXTBOX n
wtext.n=result
end
wtext.6="«:NEXT»"
DO i = 1 to col
DO j = 1 to num_labels
ACTIVATETEXTFRAME objectid.i.j
DO n= 1 to 6
if wtext.n="" then iterate
TEXT wtext.n
NEWPARAGRAPH
end
end
end
SAVEAS
REQUESTNOTIFY PROMPT "Label Sheet Maker Finished!!"
exit